/**
 * This script handles the set up of the index page by setting
 * up event handlers, animations, etc.
 *
 * @author nicholas malacarne <nicholas.malacarne@gmail.com>
 */

// load required scripts -nm
$.loadScript( "js/Event.js" );
$.loadScript( "js/AnimationFactory.js" );
$.loadScript( "js/AjaxFactory.js" );

// execute when page ready -nm
$( document ).ready(function() {
    
    var animation_factory   = new AnimationFactory();
    var ajax_factory        = new AjaxFactory();
    
    new Event().create({
        
        target:     "body",
        type:       "isLoggedIn",
        handler:    ajax_factory.get( "get_info" ),
        override:   true
        
    }).trigger();
    
    new Event().create({
        
        target:     "#calltoaction",
        type:       "click",
        handler:    animation_factory.get( "index_scroll" ),
        override:   true
    });
});